import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'

export default defineConfig({
	plugins: [uni()],
	server: {
		proxy: {
			'/api': {
				target: 'http://localhost:8080',
				changeOrigin: true,
				rewrite: (path) => {
					// console.log(678)
					return path.replace(/^\/api/, '')
				}
			},
			"/tx": {
				target: `https://apis.map.qq.com`,
				changeOrigin: true,
				rewrite: (path) => path.replace(/^\/tx/, '') // 统一使用 rewrite
				// pathRewrite: {
				// 	'^/tx': ''
				// }
			}
		}
	}
})